"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Player = exports.Bullet = void 0;
const schema_1 = require("@colyseus/schema");
const ArraySchema_1 = require("@colyseus/schema/lib/types/ArraySchema");
const GameObject_1 = require("./GameObject");
class Bullet extends GameObject_1.GameObject2D {
    constructor() {
        super();
        this.speed = 20;
        this.damage = 20;
        this.x = 0;
        this.x = 0;
        this.w = 5;
        this.h = 5;
    }
}
__decorate([
    schema_1.type("number")
], Bullet.prototype, "speed", void 0);
__decorate([
    schema_1.type("number")
], Bullet.prototype, "damage", void 0);
exports.Bullet = Bullet;
class Player extends GameObject_1.GameObject2D {
    constructor() {
        super();
        this.name = "";
        // 0 △ 1 <- 2 ▽ 3 ->
        this.dir = 2;
        this.speed = 10;
        this.color = "";
        this.hp = 100;
        this.active = true;
        // 子弹组
        this.bullets = new ArraySchema_1.ArraySchema();
        this.x = 10;
        this.y = 10;
        this.w = 50;
        this.h = 50;
    }
}
__decorate([
    schema_1.type("string")
], Player.prototype, "name", void 0);
__decorate([
    schema_1.type("number")
], Player.prototype, "dir", void 0);
__decorate([
    schema_1.type("number")
], Player.prototype, "speed", void 0);
__decorate([
    schema_1.type("string")
], Player.prototype, "color", void 0);
__decorate([
    schema_1.type("number")
], Player.prototype, "hp", void 0);
__decorate([
    schema_1.type("boolean")
], Player.prototype, "active", void 0);
__decorate([
    schema_1.type([Bullet])
], Player.prototype, "bullets", void 0);
exports.Player = Player;
